www.gusucode.com > 8:【198-3690】html5响应式网站织梦模板源码 IT网络工作室整站(自适应手机) > 8:【198-3690】html5响应式网站织梦模板源码 IT网络工作室整站(自适应手机)/skins/js/newsJs.js
// JavaScript Document $(document).ready(function() { $(".Dtiasul li a img").each(function(index, element) { $(this).attr("srcYS",$(this).attr("src")); $(this).attr("src","/images/kong.gif"); $(this).addClass("srcYSAA"); }); var clrsedint; $(window).scroll(function(){ if($(".srcYSAA").length<1) return; clearInterval(clrsedint); clrsedint=setInterval(eachupdataSrc,300); }) $(window).resize(function(){ if($(".srcYSAA").length<1) return; clearInterval(clrsedint); clrsedint=setInterval(eachupdataSrc,300); }) eachupdataSrc(); function eachupdataSrc(){ $(".srcYSAA").each(function(index, element) { var windowHt=$(window).height(); var widnowsc=$(window).scrollTop(); if($(this).offset().top<windowHt+widnowsc){ $(this).attr("src",$(this).attr("srcYS")).removeClass("srcYSAA").removeAttr("srcYS");; } }); } });